const express = require('express')
const router = express.Router()
const oumei = require('../get/oumei')
const movie = require('../get/movie')
const dongman = require('../get/dongman')
const search = require('../get/search')
const kehuan = require('../get/kehuan')
const tvshow = require('../get/tvshow')
const zongyi = require('../get/zongyi')
const Content = require('../get/getContent')
const play = require('../get/play')
router.all('*', function(req, res, next) {
  console.log(req.method);
  res.header("Access-Control-Allow-Origin", "*");
  res.header('Access-Control-Allow-Headers', 'Content-type');
  res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS,PATCH");
  res.header('Access-Control-Max-Age',1728000);//预请求缓存20天
  // res.send('movie')
  next();  
});
router.use('/kehuan',kehuan)
router.use('/tvshow',tvshow)
router.use('/zongyi',zongyi)
router.use('/oumei',oumei)
router.use('/movie',movie)
router.use('/content',Content)
router.use('/search',search)
router.use('/dongman',dongman)
router.use('/play',play)
router.get('/mm',(req,res)=>{
  console.log(req.url);

  res.send(JSON.stringify(['req','dd']))

})

module.exports = router